import java.util.*;

/*
Create the following class - StudentComparator
A.	The class must implement the Comparator interface.
B.	This class should compare two StudentID objects based first on their last name and then on the first name of the student.
C.	Make sure to name variables and methods appropriately.  The methods should have appropriate modifiers, return types, and parameter numbers/types - if you create any.
*/

public class StudentID implements Comparable
{
	private String firstName;
	private String lastName;
	private Integer ID;
	private String address;
	private String city;
	private String state;
	private Integer zipCode;
	private String phoneNumber;

	public StudentID(String fName, String lName, Integer newID, String add, String cit, String st, Integer zip, String phone)
	{
		firstName = fName;
		lastName = lName;
		ID = newID;
		address = add;
		city = cit;
		state = st;
		zipCode = zip;
		phoneNumber = phone;
	}

	public void setName(String fName, String lName)
	{
		firstName = fName;
		lastName = lName;
	}

	public void setID(Integer newID)
	{
		ID = newID;
	}

	public String getFName()
	{
		return firstName;
	}

	public String getLName()
	{
		return lastName;
	}

	public Integer getID()
	{
		return ID;
	}

	public String getAddres()
	{
		return address;
	}

	public String getCity()
	{
		return city;
	}

	public String getState()
	{
		return state;
	}

	public Integer getZip()
	{
		return zipCode;
	}

	public String getPhone()
	{
		return phoneNumber;
	}

	public String toString()
	{
		return "Student: " + ID + " is " + firstName + " " + lastName ;//+ "\n" + address + "\n" + city + ", " + state.toUpperCase() + " " + zipCode + "\n" + phoneNumber;
	}

	public boolean equals(Object oth)
	{
		StudentID other = (StudentID)oth;

		if(this.getFName().equals(other.getFName()) && this.getLName().equals(other.getLName()) && this.getID().equals(other.getID()))
			return true;
		else
			return false;
	}

	public int compareTo(Object oth)
	{
		StudentID other = (StudentID)oth;
		int ret = this.getID().compareTo(other.getID());
		return ret;
	}

}